package chapter06.Example02;

import java.util.LinkedList;

public class Example02 {
    public static void main(String[] args) {
        LinkedList link = new LinkedList();
        link.add("张战泽");//向列表中添加String对象
        link.add("吕文右");
        link.add("黄岩松");
        link.add("廖元合");
        System.out.println("list元素个数"+link.size());
        System.out.println("查看第二个元素"+link.get(1));
        System.out.println(link);
        link.set(2,"隔壁新强");//替换指定元素
        System.out.println(link);
        link.remove(2);
        System.out.println(link);
        link.add(Math.PI);//列表中放入其他元素
        System.out.println(link);
    }
}
